<?php

use App\Http\Controllers\AdminController;
use App\Http\Controllers\ExtertController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\VideoController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/login',[UserController::class,'login'])->name('login');
Route::post('/login',[UserController::class,'dologin']);
Route::get('/logout',[UserController::class,'logout'])->middleware('auth');



Route::get('/',[UserController::class,'index']);
Route::get('/people',[ExtertController::class,'people']);
Route::get('/conf/{id}',[ExtertController::class,'expert_list']);
Route::get('/review',[VideoController::class,'review']);
Route::get('/review/list',[VideoController::class,'list']);




Route::get('/adm',[AdminController::class,'admin'])->middleware('auth');
Route::prefix('adm')->middleware('auth')->group(function (){
    Route::get('/user',[UserController::class,'list_adm']);
    Route::get('/user/add-user',[UserController::class,'create']);
    Route::post('/user/add-user',[UserController::class,'store']);
    Route::get('/user/edit-user/{id}',[UserController::class,'edit']);
    Route::post('/user/edit-user/{id}',[UserController::class,'update']);
    Route::delete('/user/{id}',[UserController::class,'destroy']);


    Route::get('/extert',[ExtertController::class,'index']);
    Route::get('/extert/add-extert',[ExtertController::class,'create']);
    Route::post('/extert/add-extert',[ExtertController::class,'store']);
    Route::get('/extert/edit-extert/{id}',[ExtertController::class,'edit']);
    Route::post('/extert/edit-extert/{id}',[ExtertController::class,'update']);



    Route::get('/video',[VideoController::class,'']);
    Route::get('/video/add-video',[ExtertController::class,'create']);
    Route::post('/video/add-video',[ExtertController::class,'store']);

});

Route::get('/test', function () {
    return view('front.index');
});
